template <typename T>
class CTask
{
protected:
    string m_strTaskName;  /** task name */
    T taskData;       /** task data */
public:
    CTask(){}
    CTask(string taskName)
    {
        m_strTaskName = taskName;
        m_ptrData = NULL;
    }
    // virtual function, define interface
    virtual int Run()= 0;

    /** set task data */
    void SetData(T &data)
    {
        taskData = data;
    }

public:
    virtual ~CTask(){}
};

class CPartUploadTask: public CTask<PartUploadParameters>
{
public:
    CPartUploadTask() {}
    CPartUploadTask(PartUploadParameters partUploadParameters)
    {
        CTask("PartUploadTask");
        SetData(partUploadParameters);
    }
    int Run()
    {
        taskData.aws_obj->m_logger(cloud_debug_all, "Out CPartUploadTask::Run() - TaskName=[%s]"
            " PartUploadParameters.partNumber=[]"
            " PartUploadParameters.contentLength=[]"
            " PartUploadParameters.aws_obj=[]"
            " PartUploadParameters.completedMultipartUpload=[]"
            " PartUploadParameters.strUploadID=[]",
            partUploadParameters.m_strTaskName.c_str(),
            partUploadParameters.partNumber,
            partUploadParameters.contentLength,
            partUploadParameters.aws_obj,
            partUploadParameters.completedMultipartUpload,
            partUploadParameters.strUploadID
            );

        // boost::atomic<bool>, don't need to be locked
        taskData.aws_obj->m_status = PartUploadThread(taskData);

        return 0;
    }

};
